<template>
  <div>
      <el-dialog
        title="提示"
        :visible.sync="showaccount"
        width="30%"
         center
        >
        <div class="centioer">
            是否停用该机构
        </div>
        <el-row type="flex" justify="center">
          <el-button  style="width:30%" class="dtebtn"  @click="dialogVisible">取 消</el-button>
          <el-button  style="width:30%" class="addbtn" type="primary" @click="okdialogVisible">确 定</el-button>
        </el-row>
      </el-dialog>
  </div>  
</template>
<script>
import  { offchare } from '@/api/menu/index.js'
export default {
    props:{
        showaccount:{
            type:Boolean,
            default:false
        },
        nodedata:{
            type:Object
        }
    },
    data(){
        return {

        }
    },
    methods:{
       //取消
        dialogVisible(){
            this.$emit('update:showaccount',false)
        },
        //确定
       async okdialogVisible (){
          var data = await offchare(this.nodedata)
          if(data.code == 200) {
              this.$message({
                message: '操作成功',
                type: 'success'
              });
              this.$parent.getjigou()
          }else {
            this.$message.error('状态更新失败');
          }
          this.$emit('update:showaccount',false)
        },
    }
}
</script>
<style lang="less" scoped>
.dtebtn{
    color: #aaa;
    border: 1px solid #999;
}
.centioer {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
</style>